﻿@model NewsMine.DomainObjects.WebSiteInfo

@{
    ViewBag.Title = "Edit";
    Layout = "~/Views/Shared/_Layout.cshtml";
    string googleImageSearchUrl = "https://www.google.ie/search?q=logo+" + Model.Domain + "&hl=en&tbo=d&source=lnms&tbm=isch";
    string tags = string.Empty;
    
    if(Model.Tags!=null && Model.Tags.Count>0)
    {
        foreach (var tag in Model.Tags)
        {
            tags = tags + tag + "#";
        }
    }
}

<h2>Edit</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>




@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset style="margin:20px;">
        <legend>WebSiteInfo</legend>

        @Html.HiddenFor(model => model.Domain)

        <a target="_blank" href='http://@Model.Domain/'>@Model.Domain</a>

        <a target="_blank" class="btn btn-danger" href="/WebSiteInfo/Delete/@Model.Domain">Delete @Model.Domain</a>

        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.LocalName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.LocalName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.HomePageUrl)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.HomePageUrl)
        </div>

          <div class="editor-label">
            @Html.LabelFor(model => model.Rank)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Rank)
        </div>

          <div class="editor-label">
            @Html.LabelFor(model => model.AlexaRank)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.AlexaRank)
        </div>
        



         <div class="editor-label">
            <label for="LocalName">Tags List with # delimeter</label>
        </div>
        <div class="editor-field">
            <textarea id="TagsList" name="TagsList">@tags</textarea>
        </div>


      @*  <div class="editor-label">
            @Html.LabelFor(model => model.Domain)
        </div>

        <div class="editor-field">
            @Html.EditorFor(model => model.Domain)
        </div>
*@
        
        <div class="editor-label">
            @Html.LabelFor(model => model.Language)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Language)
        </div>

        <a href='@googleImageSearchUrl' target="_blank">Search for logo in Google</a>
        <div class="editor-label">
            @Html.LabelFor(model => model.Logo1Uri)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Logo1Uri)
        </div>

    @*    <div class="editor-label">
            @Html.LabelFor(model => model.Logo2Uri)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Logo2Uri)
        </div>*@


     @*   <div class="editor-label">
            @Html.LabelFor(model => model.IsHtmlScrapingEnabled)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.IsHtmlScrapingEnabled)
        </div>*@

      @*  <div class="editor-label">
            @Html.LabelFor(model => model.FrequencyOfUpdates)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.FrequencyOfUpdates)
        </div>

     <div class="editor-label">
            @Html.LabelFor(model => model.ParentDomain)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ParentDomain)
        </div>*@


        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Description)
        </div>

       @* <div class="editor-label">
            @Html.LabelFor(model => model.FaviconIconUri)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.FaviconIconUri)
        </div>*@


     @*   <div class="editor-label">
            @Html.LabelFor(model => model.Logo3Uri)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Logo3Uri)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Logo4Uri)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Logo4Uri)
        </div>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.LastCrawledTimeStampGMT)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.LastCrawledTimeStampGMT)
        </div>
*@
        <div class="editor-label">
            @Html.LabelFor(model => model.IsAdultContentSite)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.IsAdultContentSite)
        </div>
@*
        <div class="editor-label">
            @Html.LabelFor(model => model.UID)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.UID)
        </div>
*@
        
        <div class="editor-label">
            @Html.LabelFor(model => model.IsActive)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.IsActive)
        </div>

   @*     <div class="editor-label">
            @Html.LabelFor(model => model.CreatedTime)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.CreatedTime)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.CreatedBy)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.CreatedBy)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ModifiedTime)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ModifiedTime)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ModifiedBy)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ModifiedBy)
        </div>*@

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@*<iframe style='width:50%;height:500px;' src='http://@Model.Domain/'> </iframe>*@


